package Generics_Reflect;

class Automobile{}
class Holder1{
	private Automobile a;
	public Holder1(Automobile a) {
		this.a=a;
	}
	Automobile get(){return a;}
}

class Holder2{
	Object a;
	Holder2(Object a){
		this.a=a;
	}
	public void set(Object a){
		this.a=a;
	}
	public Object get(){
		return a;
	}
}

class Holder3<T>{
	private T a;
	public Holder3(T a){
		this.a=a;
	}
	public T get() {
		return a;
	}
	public void set(T a) {
		this.a = a;
	}
	
}
public class HolderTest {
	public static void main(String[] args) {
		Holder2 h2=new Holder2(new Automobile());
		Automobile a=(Automobile)h2.get();
		h2.set("Niekoniecznie Automobile");
		String s=(String)h2.get();
		h2.set(1);
		Integer x=(Integer)h2.get();
		
		Holder3<Automobile> h3=new Holder3<Automobile>(new Automobile());
		Automobile a2 = h3.get();

	}

}
